module.exports = function($scope,items,$resource,$modalInstance){
    console.log("进来了吗？");
    console.log(items.code);
     $scope.redpacketorderd={};
     $resource('/api/as/puc/redpacketorder/findRedPacketOrderInfoList', {}, {}).save({code:items.code}, function(res){
        if(res.errcode==0){
             $scope.redpacketorderd=res.data.results[0];
              $scope.redpacketorderd.rp_fee=res.data.results[0].rp_fee/100;
                         if($scope.redpacketorderd.rp_status=="01"){
                            $scope.redpacketorderd.rp_status="发放";
                         }
                         if($scope.redpacketorderd.rp_status=="02"){
                            $scope.redpacketorderd.rp_status="自行领取";
                         }
                         if($scope.redpacketorderd.rp_send_status=="01"){
                            $scope.redpacketorderd.rp_send_status="已领取";
                         }
                         if($scope.redpacketorderd.rp_send_status=="02"){
                            $scope.redpacketorderd.rp_send_status="未领取";
                         }
                         $scope.redpacketorderd.otime=new Date(res.data.results[i].otime);
                         $scope.redpacketorderd.rtime=new Date(res.data.results[i].rtime);
                         //alert();
                         if($scope.redpacketorderd.rtime=="Invalid Date"){
                            $scope.redpacketorderd.rtime="";
                         }    
        }else{
            alert(res.errmsg);
        }
      });
    $scope.cancel = function () {
            $modalInstance.dismiss('cancel');
    };   
}